package com.zf.zffencheng.controller.tenant;

import com.zf.zffencheng.model.Result;
import com.zf.zffencheng.model.dto.AllDeviceDTO;
import com.zf.zffencheng.model.vo.AdminLoginInfoVo;
import com.zf.zffencheng.strategy.DeviceStrategy;
import com.zf.zffencheng.util.UserContextUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: ScanCodeController <br/>
 * Description:  <br/>
 * date: 2021/5/28 14:14<br/>
 *
 * @author william <br/>
 */
@Api(tags = "扫码添加")
@RestController
@RequestMapping("/spi/tenant/scan")
public class ScanCodeController {

    @ApiOperation("寺院扫码添加")
    @PostMapping("/code/paiwei")
    public Result scanCodePaiWei(@RequestBody AllDeviceDTO paiWeiDTO){
        paiWeiDTO.setDeviceType(DeviceStrategy.PAIWEI);
        AdminLoginInfoVo currentAdminInfo = UserContextUtils.getCurrentAdminInfo();
        paiWeiDTO.setTenantId(currentAdminInfo.getAccountId());
        return Result.ok();
    }
}
